package com.flexdms.i18n;

import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextFactory;
import javax.faces.lifecycle.Lifecycle;

public class LocalizedFacesContextFactory extends FacesContextFactory
{

	FacesContextFactory parent;
	
	public LocalizedFacesContextFactory(FacesContextFactory parent)
	{
		this.parent = parent;
	}

	
	@Override
	public FacesContextFactory getWrapped()
	{
		return parent;
	}


	@Override
	public FacesContext getFacesContext(Object context, Object request,
			Object response, Lifecycle lifecycle) throws FacesException
	{
		FacesContext context2=parent.getFacesContext(context, request, response, lifecycle);
		return new LocalizedFacesContext(context2);
	}

}
